package org.xin.security.controller;

import cn.hutool.core.lang.Assert;
import cn.hutool.core.lang.Dict;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.xin.common.util.XinUtil;
import org.xin.security.component.UserLoginComponent;
import org.xin.security.component.UserRegisterComponent;
import org.xin.security.pojo.bo.SecurityUser;
import org.xin.security.pojo.entity.SysUser;
import org.xin.security.pojo.form.UserLoginForm;
import org.xin.security.pojo.form.UserRegisterForm;
import org.xin.security.service.ISysUserService;

import org.xin.framework.base.controller.IBaseController;
import org.xin.common.result.Result;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
* <p>
    * 系统模块-用户表 前端控制器
    * </p>
*
* @author: xin
* @date: Create in 2021-09-29
*/
@Api(tags = "系统模块-用户信息")
@CrossOrigin
@RestController
@RequestMapping("/sysUser")
public class SysUserController extends IBaseController<SysUser, ISysUserService> {
    @ApiOperation("获取用户信息")
    @GetMapping("/getUserInfo")
    public Result getUserInfo(HttpServletRequest request, HttpServletResponse response){
        return Result.success(service.loginUserInfo(request));
    }
}

